home *** CD-ROM | disk | FTP | other *** search
- <? php
- $stop_message = "La date et l'heure sont dépassées";
- $stop_url = "http://www.yahoo.com";
- $stop_script = "test.php";
- $action = "1";
-
- $jour = "19";
- $mois = "09";
- $annee = "2001";
- $secondes = "00";
- $minutes = "35";
- $heures = "09";
- function executer_action($action, $action_variable)
- {
- if($action == "1"){
- print("<h3><font face=arial>$action_variable</font></h3>");
- }
- elseif($action == "2"){
- print("<html><head><meta http-equiv=\"Refresh\" content=\"1;URL=$action_variable\"></head><body></body></html>");
- }
- else{
- require("$action_variable");
- }
- }
- if(checkdate($mois,$jour,$annee)){
- $maintenant = time();
- $compte_rebours_fin = mktime($heures, $minutes, $secondes, $mois, $jour, $annee);
- $reste = $compte_rebours_fin - $maintenant;
- if($compte_rebours_fin <= $maintenant){
- if($action == "1"){
- $action_variable = $stop_message;
- executer_action($action, $action_variable);
- }
- if($action == "2"){
- $action_variable = $stop_url;
- executer_action($action, $action_variable);
- }
- if($action == "3"){
- $action_variable = $stop_script;
- executer_action($action, $action_variable);
- }
- }
- if($compte_rebours_fin > $maintenant){
- print("Date STOP : ".date("j/n/Y - H:i:s",$compte_rebours_fin));
- }
- }
- else{
- print("<font face=arial><b>Erreur dans la date</b></font>");
- }
- ?>
-
-